﻿using System;

namespace JustForTest
{
    public class Program
    {
        static void Main(string[] args)
        {
            var myClass = new MyClass();
            myClass.PrintHelloWorld();
            Console.ReadLine();
        }
    }

    public class MyClass
    {
        [Other]
        [Logging]
        public void PrintHelloWorld()
        {
            System.Console.WriteLine("Hello, world");
            System.Console.WriteLine("Hello, world2");
        }
    }

    public interface IMethodAOP
    {
        void OnExecuting();
        void OnExecuted();
    }

    public abstract class MethodAOPAttribute : Attribute, IMethodAOP
    {
        public abstract void OnExecuting();
        public abstract void OnExecuted();
    }

    public class LoggingAttribute : MethodAOPAttribute
    {
        public override void OnExecuting()
        {
            System.Console.WriteLine("Inject: OnExecuting");
            System.Console.WriteLine();
        }

        public override void OnExecuted()
        {
            System.Console.WriteLine();
            System.Console.WriteLine("Inject: OnExecuted");
        }
    }

    public class OtherAttribute : Attribute
    {
    }
}
